package com.company;

import java.util.Arrays;

/**
 * @author zhf
 * @date 2022/2/10
 */
public class SingleNumber {
    public static void main(String[] args) {
        SingleNumber singleNumber = new SingleNumber();
        int[] nums = new int[]{2,2,3,3,6};
        int i = singleNumber.singleNumber(nums);
        System.out.println(i);
    }
    public int singleNumber(int[] nums) {
        int ans = 0;
        for (int num : nums) {
            ans ^= num;
        }
       return ans;
    }
}
